/**
 * LabelServiceImpl.java created by zhangzhidong 
 * at 下午2:08:58 2016年4月19日
 */
package service.wechatlab.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.wechatlab.LabelDao;
import pojo.weichatlab.Label;
import service.wechatlab.LabelService;

/**
 * @author zhangzhidong
 *
 */
@Service
public class LabelServiceImpl implements LabelService {
	@Autowired LabelDao ld ;
	/**
	 * @Param
	 * @Author zhangzhidong
	 */
	public void addLabels(List<Label> list) {
		// TODO Auto-generated method stub
		for(Label label:list){
			ld.saveLabel(label);
		}
	}
	/**
	 * 选出所有的类
	 * @Param
	 * @Author zhangzhidong
	 */
	public List<Label> selectAllLabels() {
		// TODO Auto-generated method stub
		return ld.selectAllLabels();
	}
	/**选出所有的父类
	 * @Param
	 * @Author zhangzhidong
	 */
	public List<Label> selectAllParentLabels() {
		return ld.selectAllParentIds();
	}
	public List<Label> fetchChildLables(Integer id){
		return ld.selectChildLables(id);
	}
	public List<Label> selectAllChildLabels(){
		return ld.selectAllChildLabels();
	}

}
